collections {

   images {
      image: "bubble-blue.png" COMP;
   }

   group {
      name: "example_group";

      parts {
         part {
            name: "background";
            type: RECT;
            physics_body: NONE;
            description {
               state: "default" 0.0;
               color: 255 255 255 255; /* white */
               rel1.relative: 0.0 0.0;
               rel2.relative: 1.0 1.0;
            }
         }

         part {
            name: "red_box";
            type: RECT;
            physics_body: RIGID_BOX;
            description {
               state: "default" 0.0;
               color: 255 0 0 255; /* light red */
               rel1.relative: 0.45 0.1;
               rel2.relative: 0.55 0.2;
               aspect: 1 1;
               physics {
                  mass: 10.8;
                  restitution: 0.85;
                  friction: 1.0;
                  light_on: 1;
               }
            }
            description {
               state: "heavier" 0.0;
               inherit: "default" 0.0;
               color: 120 0 0 255; /* dark red */
               physics {
                  mass: 30;
                  restitution: 0;
                  damping: 0.4 0.2;
                  sleep: 18 13.4;
               }
            }
         }

         part {
            name: "box_shadow";
            type: RECT;
            description {
               state: "default" 0.0;
               color: 0 0 0 120;
               rel1 {
                  to_y: "red_box";
                  relative: 0.9 0.1;
               }
               rel2 {
                  to_y: "red_box";
                  relative: 1 0.9;
               }
            }
         }

         part {
            name: "blue_circle";
            type: IMAGE;
            physics_body: RIGID_SPHERE;
            description {
               state: "default" 0.0;
               rel1.relative: 0.75 0.1;
               rel2.relative: 1 0.3;
               aspect: 1 1;
               image {
                  normal: "bubble-blue.png";
               }
               physics {
                  ignore_part_pos: 0;
                  material: IRON;
               }
            }
            description {
               state: "left" 0.0;
               inherit: "default" 0.0;
               rel1.relative: 0 0.1;
               rel2.relative: 0.25 0.3;
               physics {
                  material: CUSTOM;
                  density: 40;
               }
            }
         }

         part {
            name: "floor";
            type: RECT;
            physics_body: BOUNDARY_BOTTOM;
            description {
               state: "default" 0.0;
               visible: 0;
               physics {
                  restitution: 0.9;
               }
            }
         }
      }

      programs {
         program {
            name: "change_box";
            signal: "load";
            in: 2 0;
            action: STATE_SET "heavier" 0.0;
            transition: LINEAR 1.5;
            target: "red_box";
         }

         program {
            name: "change_circle";
            signal: "load";
            in: 3 0;
            action: STATE_SET "left" 0.0;
            target: "blue_circle";
            after: "change_circle_2";
         }

         program {
            name: "change_circle_2";
            in: 3 0;
            action: STATE_SET "default" 0.0;
            target: "blue_circle";
            after: "change_circle";
         }
      }

   }
}
